package wc.controller.factory;

import wc.model.component.Component;
import wc.model.component.roomcomponent.CashRegister;
import wc.model.component.roomcomponent.ComputerStoreCashRegister;
import wc.model.component.roomcomponent.ComputerStoreDoor;
import wc.model.component.roomcomponent.ComputerStoreShelf;
import wc.model.component.roomcomponent.StoreDoor;
import wc.model.component.roomcomponent.StoreShelf;
import wc.model.grid.TileGrid;

public class ComputerStoreComponentFactory extends StoreComponentFactory {
	private static ComputerStoreComponentFactory instance = null;

	private ComputerStoreComponentFactory() {}
	
	public static ComputerStoreComponentFactory getInstance() {
		if(instance == null) {
			instance = new ComputerStoreComponentFactory();
		}
		return instance;
	}

	public Object clone() throws CloneNotSupportedException {
		throw new CloneNotSupportedException(); 
	}

	public CashRegister createCashRegister() {
		TileGrid<Component> tg = new TileGrid<Component>(1,1);
		CashRegister c = new ComputerStoreCashRegister(tg);
		tg.setComponent(0, 0, c);
		return c;
	}
	
	public StoreDoor createStoreDoor() {
		TileGrid<Component> tg = new TileGrid<Component>(2,1);
		StoreDoor c = new ComputerStoreDoor(tg);
		tg.setComponent(0, 0, c);
		tg.setComponent(1, 0, c);
		return c;
	}
	
	public StoreShelf createStoreShelf() {
		TileGrid<Component> tg = new TileGrid<Component>(1,1);
		StoreShelf c = new ComputerStoreShelf(tg);
		tg.setComponent(0, 0, c);		
		return c;
	}
}
